// pages/backMoney/backMoney.js
var util = require('../../utils/util');
const App = getApp()

Page({
  data: {
    date: util.currentMonth(), //日期
    paymentReceiptInfo: {},
    paymentReceiptList: []
  },
  async onShow() {
    await this.getDetailData()
    await this.getDetailList()
  },
  async getDetailData() {
    // 获取回款详情
    let data = await App.$axios.request({
      url: "/educational/overview/paymentReceipt",
      method: 'GET',
      loading: true,
      data: {
        queryMonth: this.data.date
      }
    })
    if (data) {
      this.setData({
        paymentReceiptInfo: data
      })
    }
  },
  async getDetailList() {
    // 获取回款详情列表
    let data = await App.$axios.request({
      url: "/educational/overview/paymentReceiptInfoPage",
      method: 'GET',
      loading: true,
      data: {
        queryMonth: this.data.date
      }
    })
    if (data) {
      this.setData({
        paymentReceiptList: data.rows
      })
    }
  }
})